import { WorkModel } from "../../../models/work.js";
const _WorkModel = new WorkModel();
var _self;
Page({

  data: {
      workList:[]
  },
  onLoad: function (options) {
    _self =this;
    this.getInitData();
  },
  changeData:function(){
    this.getInitData();
  },
　getInitData:function(){
   _WorkModel.fetch(function(data){
     _self.setData({
       workList:data
     })
   })
  },
  editWork:function(e){
    let json = this.data.workList[e.currentTarget.dataset.current];
    wx.navigateTo({
      url: '/pages/profile/work/edit/index?type=edit&current=' + JSON.stringify(json)
    })
  }
})